# Mission 6 (through Objective 6) from botcore import * thresh = 2000 is_reflective = False SPEED = 30 # --- Safety feature --- while True: if buttons.was_pressed(0): break # === Main program === motors.enable(True) while True: vals = ls.check(thresh, is_reflective) leds.ls(vals) if vals[0]: # Left edge hit, turn left motors.run(LEFT, 0) motors.run(RIGHT, SPEED) elif vals[4]: # Right edge hit, turn right motors.run(LEFT, SPEED) motors.run(RIGHT, 0) elif vals[1] or vals[2] or vals[3]: # Move forward motors.run(LEFT, SPEED) motors.run(RIGHT, SPEED)